<?


echo '<div class="clientlogin_content">';
$client=ORM::factory('client', $this->session->get('clientid'));
$clientdata=$client->orderby('category')->clientdata->as_array();
$containers=ORM::factory('clientdata')->containers;

if($client->id!=0){
	
	echo '<h1>Daten von '.$client->title.'</h1>';
	
	foreach($containers as $key=>$container){
		echo '<div class="container">';
		echo '<h1>'.$container.'</h1>';
		foreach($clientdata as $data){
			if($data->category==$key){	
				echo '<div class="data">';
				if($data->title==''){
					$data->title='datei';
				}
				
				echo html::file_anchor( $data->url, $data->title, array('target'=>'_blank'));	
				echo '</div>';
			}
		}
		echo '</div>';
	}
}else{
	echo 'not logged in';
}

echo '</div>';

?>